#! /usr/bin/env python3

import asyncio
import aiohttp

async def func1(url):
    print(f"start download {url}")
    await asyncio.sleep(3)
    print(f"finish download {url}")
async def func2(url):
    print(f"start download {url}")
    await asyncio.sleep(2.5)
    print(f"finish download {url}")
async def func3(url):
    print(f"start download {url}")
    await asyncio.sleep(4)
    print(f"finish download {url}")


async def main():
    task = []
    urls = [
        'https://www.baidu.com',
        'http://localhost:8090',
        'http://39.108.225.238:8080/jenkins',
        'https://jd.cn'
    ]
    for url in urls:
        task.append(asyncio.create_task(func2(url)))
    await asyncio.wait(task)


asyncio.run(main())
